home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_voicelinelighttrap.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  176 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_voicelineLightTrap.cog
  4. #
  5. #
  6. # [GGJ]
  7. #
  8. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  9. #
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. message    entered
  15. message    startup
  16. message    activated
  17.  
  18. sector    trapSector
  19.  
  20. cog        lightTrap                                    
  21.  
  22. sound    dialogue=pu02j01.wav    local                
  23.  
  24. template        tplActor=indy_sh_actor            local    
  25.  
  26. keyframe        kneel=0in_stand6.key                local
  27.  
  28. thing    camTarget0
  29. thing    handTarget
  30. thing    armGhost
  31. thing    kneelGhost
  32. thing    familiarCam                                        
  33. thing    LTresetCam
  34. thing    handCam
  35. thing    forrestal                                    
  36. thing    actor                local                    
  37. thing    arm
  38. thing    shaftGhost                                    
  39. thing    player                local
  40. thing    LTstartGhost                    
  41.  
  42. int        once=0                local                    
  43. int        tempCam                local                    
  44. int        curCam                local                    
  45.  
  46. flex    tempRotVel            local
  47. flex    playerSpot            local
  48.  
  49. end
  50. # ========================================================================================
  51. code
  52. startup:
  53.     player = GetLocalPlayerThing();
  54.     SetThingCollideSize(forrestal, 0.075);
  55.     SetThingFlags(arm, 0x80000);
  56.     
  57. return;
  58.  
  59. entered:
  60. Print("entered");
  61. if ((GetSenderRef() == trapSector) && (once == 0))
  62. {
  63.     once = 1;
  64.     curCam = GetCurrentCamera();
  65.     
  66.     #Stop the player from moving and put him in a standing position
  67.     StopThing(player);
  68.     PlayMode(player, 1, 0);
  69.     DeselectWeapon(player);
  70.     DeselectWeaponWait(player);
  71.     Sleep(0.01);
  72.  
  73.     #jump the player forward to a ghost
  74.     CopyOrientandPos(LTstartGhost, player);
  75.     
  76.     #Create an actor at the player's location and swap them out
  77.     actor = CreateThing(tplActor, player);
  78.     CaptureThing(actor);
  79.     
  80.     CopyPlayerHolsters(player, actor);
  81.     SetThingFlags(player, 0x80000);
  82.     SetActorFlags(player, 0x200000);
  83.     ClearThingFlags(actor, 0x80000);
  84.  
  85.     SetCameraFocus (2, familiarCam);
  86.     SetCameraLookInterp(2, 0);
  87.     SetCameraSecondaryFocus(2, LTcamTarget0);
  88.     SetCurrentCamera(2);
  89.     SetCameraFOV(45, 0, 0.0);
  90.     Sleep(0.5);
  91.     
  92.     SetCameraLookInterp(2, 1);
  93.     SetCameraInterpSpeed(2, 3.5);
  94.     
  95.     Sleep(0.25);
  96.     MoveToFrame(LTcamTarget0, 1, 0.5);
  97.     MoveToFrame(familiarCam, 1, 1.5);
  98.     
  99.     SetCameraFOV(90, 1, 3.25);
  100.     
  101.     Sleep(0.1);
  102.     
  103.     SetCameraSecondaryFocus(2, forrestal);
  104.     
  105.     #Turn actor to look at the shaft
  106.     tempRotVel=GetThingMaxRotVel(actor);
  107.     SetThingMaxRotVel(actor, 100.0);
  108.     AISetLookThing(actor, shaftGhost);
  109.     Sleep(0.5);
  110.     
  111.     PlayVoice(actor, dialogue, 1, 0);
  112.     Sleep(1.5);
  113.     
  114.     AISetLookThing(actor, forrestal);
  115.     Sleep(4.0);
  116.     
  117.     CopyOrientandPos(actor, player);
  118.     SetThingFlags(actor, 0x80000);
  119.     SetThingMaxRotVel(actor, tempRotVel);
  120.     ClearThingFlags(player, 0x80000);
  121.     ClearActorFlags(player, 0x200000);
  122.     ResetCameraFOV(0, 0.0);
  123.     SetCameraLookInterp(2, 0);
  124.     
  125.     tempCam = GetThingPos(LTresetCam);
  126.     SetCameraPosition(curcam, tempCam);
  127.  
  128.             
  129.     SetCurrentCamera(curcam);
  130. }
  131. return;
  132.  
  133. activated:
  134. if (GetSenderRef() == forrestal)
  135. {
  136.     actor = CreateThing(tplActor, kneelGhost);
  137.     CaptureThing(actor);
  138.     SetThingFlags(player, 0x80000);
  139.     SetActorFlags(player, 0x200000);
  140.     ClearThingFlags(actor, 0x80000);
  141.     CopyOrientandPos(actor, player);
  142.     
  143.     PlayKey(actor, kneel, 4, 0x12, 0);
  144.     
  145.     Sleep(1.0);
  146.     
  147.     SetCameraFocus (2, handCam);
  148.     SetCameraLookInterp(2, 0);
  149.     SetCameraSecondaryFocus(2, handTarget);
  150.     SetCurrentCamera(2);
  151.     SetCameraFOV(30, 0, 0.0);
  152.     Sleep(0.5);
  153.     
  154.     ClearThingFlags(arm, 0x80000);
  155.     AISetMoveThing(arm, armGhost, 1);
  156.     Sleep(1.0);
  157.     SetThingFlags(arm, 0x80000);
  158.     SetCurrentCamera(curCam);
  159.     SendMessage(lightTrap, user0);
  160.     Sleep(1.0);
  161.     AISetLookThing(actor, Sapito);
  162.     Sleep(4.0);
  163.     
  164.     ClearThingFlags(player, 0x80000);
  165.     ClearActorFlags(player, 0x200000);
  166.     SetThingFlags(actor, 0x80000);
  167. }
  168. return;
  169. end
  170.     
  171.  
  172.  
  173.  
  174.  
  175.  
  176.